package com.jrx.anytxn.transaction.job.autoPayment.step;

import com.jrx.anytxn.transaction.mapper.ext.ExtBtAutoPaymentListMapper;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.JobExecutionListener;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 批扣初始化监听
 * 清空初始化表内数据
 *
 * @author : zhenghaopu
 * 2019/11/23
 */
@Service
public class AutoPaymentInitListener implements JobExecutionListener {

    @Resource
    private ExtBtAutoPaymentListMapper extBtAutoPaymentListMapper;

    @Override
    public void beforeJob(JobExecution jobExecution) {
        extBtAutoPaymentListMapper.deleteAll();
    }

    @Override
    public void afterJob(JobExecution jobExecution) {

    }
}
